import downloadByUpname
import downloadMultiPart
import getM4A
import getCookie
import os


class Infinit:
    def __iter__(self):
        return self

    def __next__(self):
        return None


n = 233
for i in Infinit():
    L = os.system("cls")
    print("欢迎使用bilibiliSpider")
    print('     1.获取cookie,用于登录')
    print('     2.据up主名字开始爬虫')
    print('     3.bv号多p爬虫')
    print('     4.MP3转码M4A')
    print('     0.退出')
    n = input("输入选择:")
    print(n)
    if(int(n) == 1):
        getCookie.getCookie()
    if(int(n) == 2):
        downloadByUpname.downloadByUpname()
    if(int(n) == 3):
        downloadMultiPart.downloadMultiPart()
    if(int(n) == 4):
        getM4A.getM4A()
    if(int(n) == 0):
        break
